package com.star.percalservice.controller;

import com.star.percalservice.service.ProcessService;
import com.star.percalservice.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author star
 * @version 1.0
 * @Description:
 * @DateTime 2025/4/13 2:15
 */

@RestController
@RequestMapping("/api/process")
public class ProcessController {

    @Autowired
    private ProcessService processService;

    /**
     * 获取所有待审核的项目
     * @return
     */
    @GetMapping("/list")
    public R list() {
        return processService.list();
    }

    /**
     * 修改审核状态
     * @param type 审核的类型 project/paper/patent/award
     * @param id 项目id
     * @param status 状态
     * @return
     */
    @PostMapping("/change")
    public R change(String type, Integer id, String status) {
        return processService.change(type, id, status);
    }

}
